#!/bin/bash
echo "start receive take timeout ...."

dir='/cyzz/pp/api'
cd $dir


# auto receive
while true; do
  pid=$(ps aux | grep auto/order-receive-timeout | grep -v grep | awk '{print $2}')
  echo ${pid}
  if [ -z "$pid" ]; then
    echo "restart..."
    nohup php ./yii auto/order-receive-timeout &
  else
    echo "running..."
  fi
  sleep 5
done
